package com.qingcloud.adminbackend.enums;

public enum EventOriginEnum {

    ONE(1, "硬件设备"),
    TWO(2, "应用系统");

    private Integer code;

    private String name;

    private EventOriginEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByCode(Integer code) {
        EventOriginEnum[] uss = values();
        for (EventOriginEnum us : uss) {
            if (us.code == code) {
                return us.name;
            }
        }
        return null;
    }
}
